<style>
label {
 font-weight: normal;
}
.panel-body li{float:left;margin-right:10px;padding:3px 3px;}
.root_li{clear:both;}
.parent_menu_title .parent_title{ font-weight: bold; }
</style>

<form action="" class="form-horizontal" role="form">
	<div class="form-group">
		<div class="col-sm-offset-2 col-sm-8">
			{$menuListHtml}
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-offset-2 col-sm-8">
		    <input type="hidden" name="pid" value="{$partner}" />
	
			<button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/saveMenu">保存更改</button>
		</div>
	</div>
</form>

<script type="text/javascript">
$(function() {
	$("input[type='checkbox']").click(function(){
		var _this = $(this);
		$(this).parents(".parent_menu_title").each(function() {
			if(_this.attr("name")!=$(this).find(".parent_title input:eq(0)").attr("name")) {
				$(this).find(".parent_title input:eq(0)").get(0).checked = true;
			}
		}); 
		var set = $(this).get(0).checked?true:false;
		$(this).parent().parent().find("ul input[type='checkbox']").each(function(i,o) {
			$(o).get(0).checked = set;
		});
	});
});
</script>